package hnue.fit.BackingAccount;

public class Account {
	private long so_tk;
	private String ten_tk;
	private double sotien;
	final int phi = 2;
	final float Laisuat = (float)0.02;

	public long getSo_tk() {
		return so_tk;
	}
	public void setSo_tk(long so_tk) {
		this.so_tk = so_tk;
	}
	public String getTen_tk() {
		return ten_tk;
	}
	public void setTen_tk(String ten_tk) {
		this.ten_tk = ten_tk;
	}
	public double getSotien() {
		return sotien;
	}
	public void setSotien(double sotien) {
		this.sotien = sotien;
	}

	public Account() {
		this.so_tk = 0;
		this.ten_tk = null;
		this.sotien = 0;
	}

	public Account(long so_tk, String ten_tk, double sotien){
		this.so_tk = so_tk;
		this.ten_tk = ten_tk;
		this.sotien = sotien;
	}

	public String toString(){
		return "So tai khoan: " + this.so_tk + "\nTen tai khoan: " + this.ten_tk + "\nSo tien: " + this.sotien;
	}

	public void Naptien(double Sotiennap)
	{
		if(Sotiennap < 0)
			System.out.println ("So tiền nạp vào tài khoản phải lớn hơn 0");
		else {
			sotien = sotien + Sotiennap;
			System.out.println("sotien"+sotien);
		}
	}

	public void Ruttien(double Sotienrut)
	{
		if(Sotienrut >sotien)
			System.out.println ("So tiền trong tai khoan ko du de rut vui long nhap lai");
		else if(Sotienrut <50){
			System.out.println("so tien rut phai >50 vui long nhap lai");
		}
		else  sotien = sotien - (Sotienrut +phi);
	}
	public void daohan(){
		sotien = sotien + sotien*Laisuat; 
	}
	
	public static void main (String args[]){
		Account acc = new Account(001, "TH", 100000);
		acc.Naptien(200000);
		acc.Ruttien(150000);
		acc.daohan();
	}
}
